﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Search.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.Search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">


        .st
        {
            font-size: medium;
        }
        .style4
        {
            font-size: x-large;
            height: 31px;
        }
        .style5
    {
        text-decoration: underline;
        color: #3399FF;
    }
        .searchContent2
        {
            height: 143px;
            text-align: center;
        }
        .searchTextSections
        {
            height: 362px;
            font-size: x-large;
        }
        .style6
        {
            color: #3399FF;
        }
        .instructionSearchTextSecion
        {
            font-size: medium;
        }
        .style7
        {
            font-size: small;
        }
        .SearchByTagTool
        {
            font-size: small;
            width: 464px;
            height: 246px;
            text-align: center;
        }
        .SearchByTagTool10
        {
            width: 424px;
            height: 248px;
            font-size: small;
            text-align: left;
        }
        .tagsListSelect
        {
            width: 172px;
            height: 124px;
        }
        .SearchForImages
        {
            height: 131px;
        }
        .SearchByTagToolMaintenance
        {
            height: 278px;
        }
        .MainStats
        {
            height: 667px;
        }
        .VideoStatsFormLink
        {
            width: 364px;
            height: 261px;
        }
        .TwoMostLikedImages
        {
            height: 375px;
        }
        .MostLikedImagesListView
        {
            width: 387px;
            height: 319px;
        }
        .TopDiscussionListView
        {
            height: 406px;
        }
        .MostLikedDiscussionListView
        {
            width: 400px;
            height: 307px;
        }
        .preferedFuelType
        {
            height: 321px;
        }
        .style8
        {
            font-size: x-large;
        }
        .MostLikedDiscussionsIntro
        {
            height: 894px;
        }
        .preferedFuelTypeGraphListView
        {
            width: 399px;
            height: 279px;
        }
        .CheapFuel
        {
            height: 40px;
            font-size: large;
            font-weight: 700;
        }
        .preferedFuelTypeGraphInfo
        {
            height: 24px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class = "searchContent">

    <strong><span class="style4">BMW - X6 <span class="style5"><em>Search &amp; Stats</em></span></span></strong>

</div>
<br />
<div class = "searchText">

Use our search tool to find what your looking for quickly and simply. 
</div>
<br />

<div class = "searchContent2">


        <asp:Image ID="Image100" runat="server" BorderStyle="Solid" Height="139px" 
            ImageUrl="~/Pictures/search.png" Width="195px" />
        <asp:Image ID="Image110" runat="server" BorderStyle="Solid" Height="139px" 
            ImageUrl="~/Pictures/bmw_repair1.jpg" style="text-align: center" 
            Width="195px" />
        <asp:Image ID="Image120" runat="server" BorderStyle="Solid" Height="139px" 
            ImageUrl="~/Pictures/search1.jpg" Width="195px" />
    
    
</div>
<br />


<div class = "searchTextSections">


    <strong>Search&nbsp;by</strong> <span class="style6"><em><strong>Tags</strong></em></span><div class = "style7">
    
        To search for content using the Tags feature, simply choose what type of area 
        you want to search by selecting an option in the drop down list, enter the tag 
        in the texbox / select the relevant tag name from the drop down list and click 
        on &#39;Search&#39;. <br />
    </div>
    <div class = "tagList">
    
    </div>
        <div class = "SearchByTagTool10">
        
        
            <br />
            Select the tag you want to search by and click on Search<br />

            
                &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<br /> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                <asp:DropDownList ID="ddlSearch2" runat="server" Height="24px" 
                Width="188px">
                    <asp:ListItem Value="ImagesByTags.aspx?TagName=">Search Tag By Images</asp:ListItem>
                    <asp:ListItem Value="MaintenanceImagesByTags.aspx?TagName=">Search Tag By Maintenance Images</asp:ListItem>
                </asp:DropDownList>
                <br />
                <br />
                <br />
                &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                <asp:DropDownList ID="ddlTags" runat="server" DataSourceID="SqlDataSource1" 
                    DataTextField="TagName" DataValueField="TagName" Height="24px" 
                Width="188px">
                </asp:DropDownList>
                <br />
                <br />
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                    
                SelectCommand="SELECT TagID, TagName FROM Tags GROUP BY TagID, TagName"></asp:SqlDataSource>
          
        
        
                <asp:Button ID="btnSearch2" runat="server" Height="35px" Text="Search" 
                    Width="253px" />
        
        
            <br />
        
        
        </div>
        
        <div class = "SearchByTagTool">
        
        
            <br />
            Enter the tag name and click Search<br />
            <br />
            <asp:DropDownList ID="ddlSearch1" runat="server" Height="24px" Width="188px">
                <asp:ListItem Value="ImagesByTags.aspx?TagName=">Search Tag By Images</asp:ListItem>
                <asp:ListItem Value="MaintenanceImagesByTags.aspx?TagName=">Search Tag By Maintenance Images</asp:ListItem>
            </asp:DropDownList>
            <br />
            <br />
            <asp:TextBox ID="txtTagNameQuery" runat="server" Height="26px" Width="226px" 
                BorderStyle="Solid" BorderColor="Black">Tag Name...</asp:TextBox>
            <br />
            <br />
            <asp:Button ID="btnSearch1" runat="server" Height="35px" Text="Search" 
                Width="253px" />
        
        
            <br />
            <br />
            <br />
        
        
        </div>



        
</div>
<div class = "MainStats">




<div class = "style4">

    <strong>5 Most <span class="style6"><em>Viewed</em></span> Videos</strong></div>
    <div class = "VideoStatsInstuctions">
    
        This graph displays the most 5 highest popular viewed Videos on our site, click 
        on the link to view the video.
    
        <br />
    
    </div>

    <div class = "VideoStatsFormLink">
    
        <br />
        <asp:ListView ID="ListView1" runat="server" DataKeyNames="VideoID" 
            DataSourceID="SqlDataSource2">
            <AlternatingItemTemplate>
                
                <strong>Video Title:</strong>
                <a href = "VideoPlay.aspx?id=<%# Eval("VideoID") %>"><%# Eval("VideoTitle") %></a>
                <br />
                <strong>Description:</strong>
                <asp:Label ID="VideoDescriptionLabel" runat="server" 
                    Text='<%# Eval("VideoDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Total Views:</strong>
                <asp:Label ID="Total_ViewsLabel" runat="server" 
                    Text='<%# Eval("[Total Views]") %>' />
                <br />
<br /></span>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <span style="">
                <strong>Video Title:</strong>
                <a href = "VideoPlay.aspx?id=<%# Eval("VideoID") %>"><%# Eval("VideoTitle") %></a>
                <br />
                <strong>Description:</strong>
                <asp:TextBox ID="VideoDescriptionTextBox" runat="server" 
                    Text='<%# Bind("VideoDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <strong>Total Views:</strong>
                <asp:TextBox ID="Total_ViewsTextBox" runat="server" 
                    Text='<%# Bind("[Total Views]") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br /><br /></span>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <span>No data was returned.</span>
            </EmptyDataTemplate>
            <InsertItemTemplate>
               
                <br /><strong>Video Title:</strong>
                <a href = "VideoPlay.aspx?id=<%# Eval("VideoID") %>"><%# Eval("VideoTitle") %></a>
                <br /><strong>Description:</strong>
                <asp:TextBox ID="VideoDescriptionTextBox" runat="server" 
                    Text='<%# Bind("VideoDescription") %>' />
                <br /><strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br /><strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br /><strong>Total Views:</strong>
                <asp:TextBox ID="Total_ViewsTextBox" runat="server" 
                    Text='<%# Bind("[Total Views]") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br /><br /></span>
            </InsertItemTemplate>
            <ItemTemplate>
                <span style="">
                <strong>Video Title:</strong>
                <a href = "VideoPlay.aspx?id=<%# Eval("VideoID") %>"><%# Eval("VideoTitle") %></a>
                <br />
                <strong>Description:</strong>
                <asp:Label ID="VideoDescriptionLabel" runat="server" 
                    Text='<%# Eval("VideoDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Total Views:</strong>
                <asp:Label ID="Total_ViewsLabel" runat="server" 
                    Text='<%# Eval("[Total Views]") %>' />
                <br />
<br /></span>
            </ItemTemplate>
            <LayoutTemplate>
                <div ID="itemPlaceholderContainer" runat="server" style="">
                    <span runat="server" id="itemPlaceholder" />
                </div>
                <div style="">
                </div>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <span style="">
                <strong>Video Title:</strong>
                <a href = "VideoPlay.aspx?id=<%# Eval("VideoID") %>"><%# Eval("VideoTitle") %></a>
                <br />
                <strong>Description:</strong>
                <asp:Label ID="VideoDescriptionLabel" runat="server" 
                    Text='<%# Eval("VideoDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Total Views:</strong>
                <asp:Label ID="Total_ViewsLabel" runat="server" 
                    Text='<%# Eval("[Total Views]") %>' />
                <br />
<br /></span>
            </SelectedItemTemplate>
        </asp:ListView>
    
    </div>
    <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource2" 
        Width="536px">
        <Series>
            <asp:Series ChartArea="ChartArea1" Name="Series1" XValueMember="VideoTitle" 
                YValueMembers="Total Views">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT TOP 5 Videos.VideoID, Videos.VideoLink, Videos.VideoTitle, Videos.VideoDescription, Videos.DateUploaded, Videos.TimeUploaded, COUNT(Video_Views_Stats.ID) AS [Total Views] FROM (Video_Views_Stats INNER JOIN Videos ON Video_Views_Stats.VideoID = Videos.VideoID) GROUP BY Videos.VideoID, Videos.VideoLink, Videos.VideoTitle, Videos.VideoDescription, Videos.DateUploaded, Videos.TimeUploaded ORDER BY COUNT(Video_Views_Stats.ID) DESC">
    </asp:SqlDataSource>





    <br />
    <asp:Image ID="Image121" runat="server" Height="217px" 
        ImageUrl="~/Pictures/BMWRev595x270banner.png" Width="534px" />





</div>

<div class = "style4">


    <strong>Top 2 Most <span class="style6"><em>Liked</em></span> Images</strong></div>
    <div class = "LikedImages">
    
        This graph displays the total <em><strong>Likes</strong></em> for two most <em>
        <strong>Liked</strong></em> Images.
    
        </div>

        <div class = "TwoMostLikedImages">
        <div class = "MostLikedImagesListView">
        
        
            <asp:ListView ID="ListView2" runat="server" DataKeyNames="ImageID" 
                DataSourceID="SqlDataSource4" style="text-align: left">
                <AlternatingItemTemplate>
                    
                    <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" BorderStyle="Solid" BorderColor="Black" />
                    <br />
                    <strong>Description:</strong>
                    <asp:Label ID="ImageDescriptionLabel" runat="server" 
                        Text='<%# Eval("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" 
                        Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" 
                        Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    <strong>Total Likes:</strong>
                    <asp:Label ID="Total_LikesLabel" runat="server" 
                        Text='<%# Eval("[Total Likes]") %>' />
                    <br />
<br /></span>
                </AlternatingItemTemplate>
                <EditItemTemplate>
                    <span style="">
                    
                    <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" BorderStyle="Solid" BorderColor="Black" />
                    <br />
                    <strong>Description:</strong>
                    <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                        Text='<%# Bind("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                        Text='<%# Bind("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                        Text='<%# Bind("TimeUploaded") %>' />
                    <br />
                    <strong>Total Likes:</strong>
                    <asp:TextBox ID="Total_LikesTextBox" runat="server" 
                        Text='<%# Bind("[Total Likes]") %>' />
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                    <br /><br /></span>
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <span>No data was returned.</span>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                   <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" BorderStyle="Solid" BorderColor="Black" />
                    <br /><strong>Description:</strong>
                    <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                        Text='<%# Bind("ImageDescription") %>' />
                    <br /><strong>Date Uploaded:</strong>
                    <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                        Text='<%# Bind("DateUploaded") %>' />
                    <br /><strong>Time Uploaded:</strong>
                    <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                        Text='<%# Bind("TimeUploaded") %>' />
                    <br /><strong>Total Likes:</strong>
                    <asp:TextBox ID="Total_LikesTextBox" runat="server" 
                        Text='<%# Bind("[Total Likes]") %>' />
                    <br />
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                    <br /><br />
                </InsertItemTemplate>
                <ItemTemplate>
                    <span style=""><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" BorderStyle="Solid" BorderColor="Black" />
                    <br />
                    <strong>Description:</strong>
                    <asp:Label ID="ImageDescriptionLabel" runat="server" 
                        Text='<%# Eval("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" 
                        Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" 
                        Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    <strong>Total Likes:</strong>
                    <asp:Label ID="Total_LikesLabel" runat="server" 
                        Text='<%# Eval("[Total Likes]") %>' />
                    <br />
<br /></span>
                </ItemTemplate>
                <LayoutTemplate>
                    <div ID="itemPlaceholderContainer" runat="server" style="">
                        <span runat="server" id="itemPlaceholder" />
                    </div>
                    <div style="">
                    </div>
                </LayoutTemplate>
                <SelectedItemTemplate>
                    <span style=""><asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" BorderStyle="Solid" BorderColor="Black" />
                    <br />
                    <strong>Description:</strong>
                    <asp:Label ID="ImageDescriptionLabel" runat="server" 
                        Text='<%# Eval("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" 
                        Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" 
                        Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    <strong>Total Likes:</strong>
                    <asp:Label ID="Total_LikesLabel" runat="server" 
                        Text='<%# Eval("[Total Likes]") %>' />
                    <br />
<br /></span>
                </SelectedItemTemplate>
            </asp:ListView>
        
        
        </div>
            <asp:Chart ID="Chart2" runat="server" DataSourceID="SqlDataSource4" 
                Width="516px">
                <Series>
                    <asp:Series Name="Series1" YValueMembers="Total Likes" 
                        XValueMember="ImageDescription">
                    </asp:Series>
                </Series>
                <ChartAreas>
                    <asp:ChartArea Name="ChartArea1">
                    </asp:ChartArea>
                </ChartAreas>
            </asp:Chart>
            
            <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                
                
                
                
                SelectCommand="SELECT TOP 1 Images.ImageID, Images.ImageLink, Images.ImageDescription, Images.DateUploaded, Images.TimeUploaded, COUNT(Image_Likes.ID) AS [Total Likes] FROM (Images INNER JOIN Image_Likes ON Images.ImageID = Image_Likes.ImageIDFK) GROUP BY Images.ImageID, Images.ImageLink, Images.ImageDescription, Images.DateUploaded, Images.TimeUploaded ORDER BY COUNT(Image_Likes.ID) DESC">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSource3" runat="server"></asp:SqlDataSource>
        
        
        
        </div>

        <div class = "style4">
        

    <strong>Top Most <span class="style6"><em>Liked</em></span> Discussions</strong></div>
        <div class = "MostLikedDiscussionsIntro">
        
        
        This graph displays the total <em><strong>Likes</strong></em> for the most <em>
        <strong>Liked</strong></em> interesting discussions.
        
            To view the discussion in more detail, simply click on the Title link which will 
            show you their posts.
        
        <br />

        <div class = "TopDiscussionListView">
        
        <div class = "MostLikedDiscussionListView">
        
        
            <asp:ListView ID="ListView3" runat="server" DataSourceID="SqlDataSource5">
                <AlternatingItemTemplate>
                    <span style="">
                    <strong>Title:</strong>
                     <a href="postsAdd.aspx?id=<%# Eval("DiscussionID") %>"><asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /></a>
                    <br />
                    <strong>Date Created:</strong>
                    <asp:Label ID="DateCreatedLabel" runat="server" 
                        Text='<%# Eval("DateCreated") %>' />
                    <br />
                    <strong>Discussion Created by:</strong>
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                    <br />
                    <strong>Total Likes:</strong>
                    <asp:Label ID="Total_LikesLabel" runat="server" 
                        Text='<%# Eval("[Total Likes]") %>' />
                    <br />
<br /></span>
                </AlternatingItemTemplate>
                <EditItemTemplate>
                    <span style="">
                    <br />
                    <strong>Title:</strong>
                    <a href="postsAdd.aspx?id=<%# Eval("DiscussionID") %>"><asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /></a>
                    <br />
                    <strong>Date Created:</strong>
                    <asp:TextBox ID="DateCreatedTextBox" runat="server" 
                        Text='<%# Bind("DateCreated") %>' />
                    <br />
                    <strong>Discussion Created by:</strong>
                    <asp:TextBox ID="UserNameTextBox" runat="server" 
                        Text='<%# Bind("UserName") %>' />
                    <br />
                    <strong>Total Likes:</strong>
                    <asp:TextBox ID="Total_LikesTextBox" runat="server" 
                        Text='<%# Bind("[Total Likes]") %>' />
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                    <br /><br /></span>
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <span>No data was returned.</span>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    <span style=""><strong>Title:</strong>
                     <a href="postsAdd.aspx?id=<%# Eval("DiscussionID") %>"><asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /></a>
                    <br /><strong>Date Created:</strong>
                    <asp:TextBox ID="DateCreatedTextBox" runat="server" 
                        Text='<%# Bind("DateCreated") %>' />
                    <br /><strong>Discussion Created by:</strong>
                    <asp:TextBox ID="UserNameTextBox" runat="server" 
                        Text='<%# Bind("UserName") %>' />
                    <br /><strong>Total Likes:</strong>
                    <asp:TextBox ID="Total_LikesTextBox" runat="server" 
                        Text='<%# Bind("[Total Likes]") %>' />
                    <br />
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                    <br /><br /></span>
                </InsertItemTemplate>
                <ItemTemplate>
                    <span style="">
                    <br />
                    <strong>Title:</strong>
                     <a href="postsAdd.aspx?id=<%# Eval("DiscussionID") %>"><asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /></a>
                    <br />
                    <strong>Date Created:</strong>
                    <asp:Label ID="DateCreatedLabel" runat="server" 
                        Text='<%# Eval("DateCreated") %>' />
                    <br />
                    <strong>Discussion Posted by:</strong>
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                    <br />
                    <strong>Total Likes:</strong>
                    <asp:Label ID="Total_LikesLabel" runat="server" 
                        Text='<%# Eval("[Total Likes]") %>' />
                    <br />
<br /></span>
                </ItemTemplate>
                <LayoutTemplate>
                    <div ID="itemPlaceholderContainer" runat="server" style="">
                        <span runat="server" id="itemPlaceholder" />
                    </div>
                    <div style="">
                    </div>
                </LayoutTemplate>
                <SelectedItemTemplate>
                    <span style="">" 
                                           
                    <strong>Title:</strong>
                     <a href="postsAdd.aspx?id=<%# Eval("DiscussionID") %>"><asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' /></a>
                    <br />
                    <strong>Date Created:</strong>
                    <asp:Label ID="DateCreatedLabel" runat="server" 
                        Text='<%# Eval("DateCreated") %>' />
                    <br />
                    <strong>Discussion Created by:</strong>
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                    <br />
                    <strong>Total Likes:</strong>
                    <asp:Label ID="Total_LikesLabel" runat="server" 
                        Text='<%# Eval("[Total Likes]") %>' />
                    <br />
<br /></span>
                </SelectedItemTemplate>
            </asp:ListView>
        
        
        </div>
        
            <asp:Chart ID="Chart3" runat="server" DataSourceID="SqlDataSource5" 
                Width="501px">
                <Series>
                    <asp:Series Name="Series1" XValueMember="Title" YValueMembers="Total Likes">
                    </asp:Series>
                </Series>
                <ChartAreas>
                    <asp:ChartArea Name="ChartArea1">
                    </asp:ChartArea>
                </ChartAreas>
            </asp:Chart>
            <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                SelectCommand="SELECT TOP 2 Discussion.DiscussionID, Discussion.Title, Discussion.DateCreated, aspnet_Users.UserName, COUNT(Posts.PostID) AS [Total Likes] FROM ((Discussion INNER JOIN Posts ON Discussion.DiscussionID = Posts.DiscussionIDFK) INNER JOIN aspnet_Users ON Discussion.UserIDFK = aspnet_Users.UserId AND Posts.UserIDFK = aspnet_Users.UserId) GROUP BY Discussion.DiscussionID, Discussion.Title, Discussion.DateCreated, aspnet_Users.UserName ORDER BY COUNT(Posts.PostID) DESC">
            </asp:SqlDataSource>
        
        
        
        </div>
        
        <div class = "preferedFuelType">
        <div class = "style8">
        

            <strong>Whats more popular, <span class="style6"><em>Petrol</em></span> or
            <span class="style6"><em>Diesel</em></span>...</strong></div>
        <br />

        <div class = "preferedFuelTypeGraphInfo">
            Find out whats more popular, Petrol or Diesel. To find the cheapest petrol 
            station near you, simply enter your poscode and click find.</div>

        <div class = "CheapFuel">
        
        
            Post Code:
            <asp:TextBox ID="txtPostCode" runat="server" BorderColor="Black" 
                BorderStyle="Solid" Height="28px" 
                style="font-size: large; font-family: Calibri" Width="215px"></asp:TextBox>
&nbsp;<asp:Button ID="btnFindPostcode" runat="server" Height="27px" Text="Find" 
                Width="111px" />
        
        
        </div>
<div class = "preferedFuelTypeGraph">
<div class = "preferedFuelTypeGraphListView">
    <asp:ListView ID="ListView4" runat="server" DataSourceID="SqlDataSource6">
        <AlternatingItemTemplate>
            <span style=""><strong>Prefered Fuel:</strong>
            <asp:Label ID="PreferedFuelLabel" runat="server" 
                Text='<%# Eval("PreferedFuel") %>' />
            <br />
            <strong>Total Votes?:</strong>
            <asp:Label ID="Most_Popular_Label" runat="server" 
                Text='<%# Eval("[Most Popular?]") %>' />
            <br />
<br /></span>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <span style=""><strong>Prefered Fuel:</strong>
            <asp:TextBox ID="PreferedFuelTextBox" runat="server" 
                Text='<%# Bind("PreferedFuel") %>' />
            <br />
            <strong>Total Votes?:</strong>
            <asp:TextBox ID="Most_Popular_TextBox" runat="server" 
                Text='<%# Bind("[Most Popular?]") %>' />
            <br />
            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                Text="Update" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Cancel" />
            <br /><br /></span>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <span>No data was returned.</span>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <span style=""><strong>Prefered Fuel:</strong>
            <asp:TextBox ID="PreferedFuelTextBox" runat="server" 
                Text='<%# Bind("PreferedFuel") %>' />
            <br /><strong>Total Votes?:</strong>
            <asp:TextBox ID="Most_Popular_TextBox" runat="server" 
                Text='<%# Bind("[Most Popular?]") %>' />
            <br />
            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                Text="Insert" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Clear" />
            <br /><br /></span>
        </InsertItemTemplate>
        <ItemTemplate>
            <span style=""><strong>Prefered Fuel:</strong>
            <asp:Label ID="PreferedFuelLabel" runat="server" 
                Text='<%# Eval("PreferedFuel") %>' />
            <br />
            <strong>Total Votes?:</strong>
            <asp:Label ID="Most_Popular_Label" runat="server" 
                Text='<%# Eval("[Most Popular?]") %>' />
            <br />
<br /></span>
        </ItemTemplate>
        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="">
            </div>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <span style="">Prefered Fuel:
            <asp:Label ID="PreferedFuelLabel" runat="server" 
                Text='<%# Eval("PreferedFuel") %>' />
            <br />
            Total Votes?:
            <asp:Label ID="Most_Popular_Label" runat="server" 
                Text='<%# Eval("[Most Popular?]") %>' />
            <br />
<br /></span>
        </SelectedItemTemplate>
    </asp:ListView>
</div>
<br />

    <asp:Chart ID="Chart4" runat="server" DataSourceID="SqlDataSource6" 
        Width="481px">
        <Series>
            <asp:Series Name="Series1" XValueMember="PreferedFuel" 
                YValueMembers="Most Popular?">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>
    <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT PreferedFuel, COUNT(PreferedFuel) AS [Most Popular?] FROM UserProfile GROUP BY PreferedFuel">
    </asp:SqlDataSource>
        
        </div>


        </div>
        

        </div>
    </asp:Content>

